INCLUDE(UsePkgConfig)

IF(WIN32)
	SET(GL_LIBRARY_NAME OpenGL32 CACHE STRING "the gl lib")
	SET(GLU_LIBRARY_NAME GLU32 CACHE STRING "the glu lib")
	SET(GLUT_LIBRARY_NAME glut32 CACHE STRING "the glut lib")
ELSE(WIN32)
	SET(GL_LIBRARY_NAME GL CACHE STRING "the gl lib")
	SET(GLU_LIBRARY_NAME GLU CACHE STRING "the glu lib")
	SET(GLUT_LIBRARY_NAME glut CACHE STRING "the glut lib")
ENDIF(WIN32)

PKGCONFIG(${GL_LIBRARY_NAME}
          GL_INCLUDE_DIR
		  GL_LIBRARY_DIR
		  GL_LIBRARY
		  GL_CFLAGS
		  )
PKGCONFIG(${GLU_LIBRARY_NAME}
          GLU_INCLUDE_DIR
		  GLU_LIBRARY_DIR
		  GLU_LIBRARY
		  GLU_CFLAGS
		  )

PKGCONFIG(${GLUT_LIBRARY_NAME}
          GLUT_INCLUDE_DIR
		  GLUT_LIBRARY_DIR
		  GLUT_LIBRARY
		  GLUT_CFLAGS
		  )
